package com.qing.picture.common;

import com.qing.picture.exception.ErrorCode;
import lombok.Data;

import java.io.Serializable;

@Data
public class BaseResponse<T> implements Serializable {
    private int code;
    private String msg;
    private T data;

    public BaseResponse(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    public BaseResponse(int code, T data) {
       this(code, "", data);
    }
    public BaseResponse(ErrorCode code) {
        this(code.getCode(), code.getMessage(), null);
    }
}
